// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_o;

import android.net.Uri;
import com.nnee.p_b.p_a.cls_ab;
import com.nnee.p_b.p_a.cls_j;
import com.nnee.p_fk.p_a.cls_m;
import com.nnee.p_o.p_a.cls_a;
import com.nnee.p_o.p_a.cls_c;
import com.nnee.p_o.p_a.cls_d;
import com.nnee.p_pr.p_atom.cls_ad;
import java.io.File;
import java.util.LinkedList;
import java.util.Vector;
import org.json.JSONArray;
import org.json.JSONObject;

// Referenced classes of package com.nnee.o:
//            a

public class cls_b extends cls_j
{

    protected cls_b(int k, String s)
    {
        super(k);
        a = s;
    }

    public static cls_b a()
    {
        return new cls_b(7, null);
    }

    public static cls_b a(String s)
    {
        return new cls_b(10, s);
    }

    public static cls_b a(String s, int k, int l)
    {
        cls_b b1 = new cls_b(8, s);
        b1.e(k);
        b1.f(l);
        return b1;
    }

    private void a(JSONObject jsonobject)
    {
        JSONArray jsonarray = jsonobject.optJSONArray("default-topicset");
        if(jsonarray != null)
        {
            LinkedList linkedlist = new LinkedList();
            for(int k = 0; k < jsonarray.length(); k++)
                linkedlist.add((new cls_d(jsonarray.optJSONObject(k))).c());

            c(0, new com.nnee.p_pr.p_prot.cls_d(linkedlist));
        }
    }

    public static cls_b b(String s)
    {
        return new cls_b(11, s);
    }

    public static cls_b b(String s, int k, int l)
    {
        cls_b b1 = new cls_b(9, s);
        b1.e(k);
        b1.f(l);
        return b1;
    }

    private void b(JSONObject jsonobject)
    {
        JSONArray jsonarray = jsonobject.optJSONArray(a);
        if(jsonarray != null)
        {
            LinkedList linkedlist = new LinkedList();
            for(int k = 0; k < jsonarray.length(); k++)
                linkedlist.add((new cls_a(jsonarray.optJSONObject(k))).k());

            com.nnee.p_pr.p_prot.cls_d d1 = new com.nnee.p_pr.p_prot.cls_d(linkedlist);
            d1.g = new cls_ad();
            com.nnee.p_f.cls_b b1 = d1.g.f("link");
            b1.b("rel", "next");
            b1.b("href", String.valueOf(b + c));
            c(0, d1);
        }
    }

    private void c(JSONObject jsonobject)
    {
        JSONObject jsonobject1 = jsonobject.optJSONObject(a);
        if(jsonobject1 != null)
        {
            LinkedList linkedlist = new LinkedList();
            linkedlist.add((new cls_c(jsonobject1)).j());
            c(1, new com.nnee.p_pr.p_prot.cls_d(linkedlist));
            c(4, null);
        }
    }

    private void e(int k)
    {
        b = k;
    }

    private void f(int k)
    {
        c = k;
    }

    public com.nnee.p_fk.p_b.cls_b a(Object obj, int k, int l)
    {
        return new com.nnee.p_o.cls_a(this, obj, k, l);
    }

    public com.nnee.p_fk.p_b.cls_b a(Vector vector, Object obj, int k, int l)
    {
        return new com.nnee.p_o.cls_a(vector, obj, k, l);
    }

    protected void a(int k, Object obj)
    {
        if(obj == null && !(obj instanceof JSONObject)){
        	super.a(k, obj);
        	return;
        }

        JSONObject jsonobject = (JSONObject)obj;
        switch(n())
        {
      
        case 7:
        	 a(jsonobject);
        	break;
        case 8:
        case 9:
        	b(jsonobject);
        	break;
        	
        case 10:
        case 11:
        	c(jsonobject);
        	break;
        default:
        	return;
        }
        
    }

    protected void b(int k, Object obj)
    {
        super.b(k, null);
    }

    public void c()
    {
    	cls_m m1 = null;
    	Object aobj[]=null;
    	Object aobj1[]=null;
    	Object aobj2[]=null;
        com.nnee.p_g.cls_b.d("NewsTransaction", (new StringBuilder()).append("NewsTransaction onTransact start ").append(System.currentTimeMillis()).toString());
        switch(n())
        {
       
        case 7:
        	 m1 = new cls_m("http://c.3g.163.com/nc/topicset/default.html");
        	break;
        case 8:
        case 9:
        	 aobj2 = new Object[3];
             aobj2[0] = a;
             aobj2[1] = Integer.valueOf(b);
             aobj2[2] = Integer.valueOf(c);
             m1 = new cls_m(String.format("http://c.3g.163.com/nc/article/headline/%1$s/%2$d-%3$d.html", aobj2));
        	break;
        case 10:
        	aobj1 = new Object[1];
            aobj1[0] = a;
            m1 = new cls_m(String.format("http://c.3g.163.com/nc/article/%1$s/head.html", aobj1));
            m1.e(true);
            m1.f(true);
        	break;
        case 11:
        	 aobj = new Object[1];
             aobj[0] = a;
             m1 = new cls_m(String.format("http://c.3g.163.com/nc/article/%1$s/tail.html", aobj));
        	break;
        default:
        	break;
        }
        
 
        if(m1 == null)
        {
            d(0, null);
            h();
        } else
        {
            m1.b("Accept-Encoding", "gzip,deflate");
            m1.b("User-Agent", "NETS Android");
            m1.b("Connection", "close");
            m1.d(true);
            m1.g(true);
            a(m1);
        }
        com.nnee.p_g.cls_b.d("NewsTransaction", (new StringBuilder()).append("NewsTransaction onTransact end ").append(System.currentTimeMillis()).toString());
        return;
    
    }

    public void c(int k, int l, int i1, Object obj)
    {
        if(l == 1000 && obj != null && (obj instanceof  com.nnee.p_b.p_a.cls_b))
        {
            com.nnee.p_b.p_a.cls_b b1 = (com.nnee.p_b.p_a.cls_b)obj;
            if(b1.b != null)
                c(3, new cls_ab(Uri.fromFile(new File(b1.b)).toString(), b1.a.hashCode()));
        }
        if(f())
            c(4, null);
    }

    public void d(int k, int l, int i1, Object obj)
    {
        if(f())
            c(4, null);
    }

    public static final int d = 1;
    public static final int e = 2;
    public static final int f = 3;
    public static final int g = 4;
    private static final String i = "NewsTransaction";
    String a;
    int b;
    int c;
}
